package nicg.st.outerAPI;

/**
 * 外部接口的URL生成
 * 
 * @author GeChen
 *
 */
public class OuterAPI {

	private String mbaseUrl;
	private String mbasePort;
	private String mapi;

	public String getBaseUrl() {
		return mbaseUrl;
	}

	public void setBaseUrl(String baseUrl) {
		this.mbaseUrl = baseUrl;
	}

	public String getBasePort() {
		return mbasePort;
	}

	public void setBasePort(String basePort) {
		this.mbasePort = basePort;
	}

	public String getApi() {
		return mapi;
	}

	public void setApi(String api) {
		this.mapi = api;
	}

	public static class Builder {
		private String baseUrl;
		private String basePort;
		private String api;

		public Builder setBaseUrl(String baseUrl) {
			this.baseUrl = baseUrl;
			return this;
		}

		public Builder setBasePort(String basePort) {
			this.basePort = basePort;
			return this;
		}

		public Builder setApi(String api) {
			this.api = api;
			return this;
		}

		public OuterAPI build() {
			OuterAPI outerAPI = new OuterAPI();
			outerAPI.setBaseUrl(baseUrl);
			outerAPI.setBasePort(basePort);
			outerAPI.setApi(api);
			return outerAPI;
		}
	}

	@Override
	public String toString() {
		return "http://" + mbaseUrl + ":" + mbasePort + mapi;
	}
}
